package com.wondertek.onvif;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * ONVIF设备管理应用主启动类
 * 
 * @author wondertek
 * @version 1.0.0
 */
@SpringBootApplication
@EnableAsync
@EnableScheduling
@ComponentScan(basePackages = {"com.wondertek.onvif", "com.onvif.manager"})
public class OnvifManagerApplication {

    private static final Logger logger = LogManager.getLogger(OnvifManagerApplication.class);

    public static void main(String[] args) {
        // 设置字符编码，解决中文乱码问题
        System.setProperty("file.encoding", "UTF-8");
        System.setProperty("console.encoding", "UTF-8");
        System.setProperty("sun.stdout.encoding", "UTF-8");
        System.setProperty("sun.stderr.encoding", "UTF-8");
        
        SpringApplication.run(OnvifManagerApplication.class, args);
        
        logger.info("");
        logger.info("  ____  _   ___     _____ _____   __  __                                   ");
        logger.info(" / __ \\| \\ | \\ \\   / /__ __|  ___| |  \\/  | __ _ _ __   __ _  __ _  ___ _ __   ");
        logger.info("| |  | |  \\| |\\ \\ / / | || |_    | |\\/| |/ _` | '_ \\ / _` |/ _` |/ _ \\ '__| ");
        logger.info("| |  | | |\\  | \\ V /  | ||  _|   | |  | | (_| | | | | (_| | (_| |  __/ |     ");
        logger.info(" \\____/|_| \\_|  \\_/  |___|_|     |_|  |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_|   ");
        logger.info("                                                          |___/            ");
        logger.info("");
        logger.info("ONVIF设备管理系统启动成功！");
        logger.info("访问地址: http://localhost:8080");
        logger.info("");
    }
}
